home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 July / 1991-07.d64 / jupiter moons (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  194 lines

  1. 100 rem copyright 1991 - compute publications intl ltd - all rights reserved
  2. 110 data metis,40,128,0,.295,0,0
  3. 120 data adrastea,40,129,0,.295,0,120
  4. 130 data amalthea,270x165x150,180,.003,.489,0,281
  5. 140 data thebe,80,222,.013,.670,0,331
  6. 150 data io,3640,422,.004,1.77,0,233
  7. 160 data europa,3100,671,.01,3.55,0,273
  8. 170 data ganymede,5270,1070,.001,7.16,0,81
  9. 180 data callisto,4990,1885,.007,16.69,0,332
  10. 190 data leda,16,11110,.147,240,280,309
  11. 200 data himalia,96,11470,.158,251,249,101
  12. 210 data lysithea,16,11710,.107,260,11,297
  13. 220 data elara,32,11740,.207,260,149,81
  14. 230 data ananke,16,21200,.17,-610,180,36
  15. 240 data carme,16,22600,.21,-690,6,239
  16. 250 data pasiphae,16,23500,.38,-734,0,90
  17. 260 data sinope,16,23700,.28,-760,226,243
  18. 270 data our moon,3478,384,.055,27.32,0,0
  19. 280 ifi=0theni=1:load"jup.ml",8,1
  20. 290 poke55,0:poke56,136:clr:q=16
  21. 300 dimsn(255),cs(255),na$(q),di$(q),cr(q),ra(q),ec(q),pe(q),pa(q),ea(q)
  22. 310 v=53248:pp=34816:sp=36856
  23. 320 s1=53200:s2=s1+8:s3=s2+8
  24. 330 yc=139.5:xc=173.5:mi=0:rj=71.6
  25. 340 tt$=" the moons of jupiter [146]  "
  26. 350 cp$="compute publications intl ltd (c) 1991"
  27. 360 wt$="calculations will take a few seconds ...":cm$="comparison"
  28. 370 dj$=" distance from center of jupiter":tk$="thousand km"
  29. 380 c0=06:c1=0:c2=14:c3=11:sc=1.3
  30. 390 data 2,3,4,5,6,7,8,9,10,12,13,14,15,4,3,2
  31. 400 print"[147]"chr$(142)chr$(8):ct=11
  32. 410 pokev+32,c0:pokev+33,c1:poke646,c2
  33. 420 print cp$:print
  34. 430 printtab(8)tt$:printwt$
  35. 440 fori=0to255:j=i*(NULL)/128
  36. 450 sn(i)=sin(j):cs(i)=cos(j):next
  37. 460 forn=0toq
  38. 470 readna$(n),di$(n),ra(n),ec(n),pe(n),j,k
  39. 480 pa(n)=(j*256/360+.5)and255
  40. 490 ea(n)=(k-j)/360:next
  41. 500 forn=0toq-1:readcr(n):next
  42. 510 fori=pptopp+126:pokei,0:next
  43. 520 pokepp+28,112:pokepp+31,112
  44. 530 pokepp+34,112:pokepp+89,112
  45. 540 pokepp+92,248:pokepp+95,248
  46. 550 pokepp+98,248:pokepp+101,112
  47. 560 t=0:print"[147]"tt$"main menu":print
  48. 570 printchr$(113)"jupiter"
  49. 580 fori=0to15:print" "na$(i):next
  50. 590 print:print"up/down=select moons"
  51. 600 print"g=go":print"c=compare":print"e=end program"
  52. 610 ifmi>6thenmi=0
  53. 620 ifmi<0thenmi=6
  54. 630 bi=(6andmi)*2
  55. 640 bo=bi+3+4*(1andmi)
  56. 650 print"":fori=0to15
  57. 660 j=113:ifi<biori>bothenj=32
  58. 670 printchr$(j):next
  59. 680 poke198,0
  60. 690 getk$:ifk$="g"then750
  61. 700 ifk$="c"then1200
  62. 710 ifk$=""thenmi=mi+1:goto610
  63. 720 ifk$="[145]"thenmi=mi-1:goto610
  64. 730 ifk$<>"e"then690
  65. 740 print"[147]":end
  66. 750 print"[147]"tt$:printwt$
  67. 760 onmi+1gosub770,780,790,800,810,820,830:goto840
  68. 770 tl=.0004:ts=.005:th=.04:return
  69. 780 tl=.005:ts=.02:th=.1:return
  70. 790 tl=.02:ts=.1:th=.4:return
  71. 800 tl=.1:ts=.2:th=.7:return
  72. 810 tl=.4:ts=3:th=12:return
  73. 820 tl=1:ts=4:th=16:return
  74. 830 tl=1.5:ts=6:th=45:return
  75. 840 ma=ra(bo)*(1+ec(bo))
  76. 850 ys=99/ma:xs=ys*sc
  77. 860 qb=bo-bi:cn=0
  78. 870 forn=0toqb:pokev+39+n,cr(n+bi):next
  79. 880 fori=0to23:pokes1+i,0:next:sys49281
  80. 890 poke53247,c1+c3*16:sys49521
  81. 900 fori=36800toi+63:pokei,32:next
  82. 910 sys49208
  83. 920 ifmi<3then960
  84. 930 fori=158to160:forj=98to100
  85. 940 poke253,i:poke254,0:poke255,j
  86. 950 sys49373:next:next:goto1000
  87. 960 fori=0to255
  88. 970 poke253,159.5+xs*rj*sn(i):poke254,0
  89. 980 poke255,99.5+ys*rj*cs(i)
  90. 990 sys49373:next
  91. 1000 gosub1980:gosub1600
  92. 1010 forn=0toqb:m=n+bi:e=ec(m):a=ea(m)+t/pe(m)
  93. 1020 a=((a-int(a))*256+.5)and255:ife<.1thenx=-cs(a):y=sn(a):goto1050
  94. 1030 z=(e*e-1)/(e*cs(a)-1):x=2*e-z*cs(a):y=z*sn(a)
  95. 1040 i=pa(m):j=x*cs(i)+y*sn(i):y=y*cs(i)-x*sn(i):x=j
  96. 1050 y=int(yc+y*ra(m)*ys):x=int(xc+x*ra(m)*xs)
  97. 1060 ify<40ory>239orx<14orx>333theny=0:x=0
  98. 1070 pokes1+n,int(x/256):pokes2+n,xand255:pokes3+n,y:next
  99. 1080 sys49281:sys49331:ifhfthen1150
  100. 1090 print" "right$(" "+str$(int(t)),3)"[145]"
  101. 1100 getk$:ifk$=""thent=t+ts:goto1010
  102. 1110 ifk$="x"thengosub1600:goto1150
  103. 1120 ifk$="f"thents=ts*1.5:ifts>ththents=th
  104. 1130 ifk$="s"thents=ts/1.5:ifts<tlthents=tl
  105. 1140 goto1100
  106. 1150 poke198,0
  107. 1160 getk$:ifk$="n"then1660
  108. 1170 ifk$="g"thengosub1630:goto1100
  109. 1180 ifk$="x"thengosub2010:goto560
  110. 1190 goto1160
  111. 1200 print"[147]"tt$"compare menu":print
  112. 1210 print"p=period":print
  113. 1220 print"d=distance":print
  114. 1230 print"e=eccentricity":print
  115. 1240 print"s=size":print
  116. 1250 print"x=main menu"
  117. 1260 poke198,0
  118. 1270 getk$:ifk$="x"then560
  119. 1280 k=val(k$)
  120. 1290 ifk$="p"then1340
  121. 1300 ifk$="d"then1410
  122. 1310 ifk$="e"then1460
  123. 1320 ifk$="s"then1520
  124. 1330 goto1270
  125. 1340 print"[147]"tt$cm$:print
  126. 1350 print"orbit period"
  127. 1360 print"(earth days)":print
  128. 1370 fori=0to16
  129. 1380 printna$(i),abs(pe(i));
  130. 1390 ifpe(i)<0thenprint"retrograde";
  131. 1400 print:next:goto1570
  132. 1410 print"[147]"tt$cm$:print
  133. 1420 print"average distance from planet center"
  134. 1430 print"(thousand km)":print
  135. 1440 fori=0to16
  136. 1450 printna$(i),ra(i):next:goto1570
  137. 1460 print"[147]"tt$cm$:print
  138. 1470 print"orbit eccentricity"
  139. 1480 print"(circle=0)":print
  140. 1490 fori=0to16
  141. 1500 printna$(i),:ifec(i)<.01thenprint0:next:goto1570
  142. 1510 printec(i):next:goto1570
  143. 1520 print"[147]"tt$cm$:print
  144. 1530 print"diameter"
  145. 1540 print"(km)":print
  146. 1550 fori=0to16
  147. 1560 printna$(i),di$(i):next:goto1570
  148. 1570 print:print"x=menu":poke198,0
  149. 1580 getk$:ifk$="x"then1200
  150. 1590 goto1580
  151. 1600 gosub1790
  152. 1610 print"g=go n=name x=menu[145]"
  153. 1620 hf=1:return
  154. 1630 gosub1790
  155. 1640 print"    earth days  f=fast s=slow x=halt[145]"
  156. 1650 hf=0:return
  157. 1660 poke198,0
  158. 1670 gosub1790:cm=cn+bi
  159. 1680 print"*"na$(cm)"*"tab(11)"i=info n=next x=continue[145]"
  160. 1690 j=9
  161. 1700 j=j+1:ifj=10thenpokesp+cn,33
  162. 1710 ifj>19thenj=0:pokesp+cn,32
  163. 1720 getk$:ifk$=""then1700
  164. 1730 pokesp+cn,32
  165. 1740 ifk$="i"then1800
  166. 1750 ifk$="x"thengosub1600:goto1150
  167. 1760 ifk$<>"n"then1690
  168. 1770 cn=cn+1:ifcn>qbthencn=0
  169. 1780 goto1660
  170. 1790 print"                                     [145]":return
  171. 1800 gosub2010
  172. 1810 print"[147]"tt$:print
  173. 1820 print"*"na$(cm)"*":print
  174. 1830 print"average"dj$:printra(cm)tk$:print
  175. 1840 print"minimum"dj$:printint(ra(cm)*(1-ec(cm))+.5)tk$:print
  176. 1850 print"maximum"dj$:printint(ra(cm)*(1+ec(cm))+.5)tk$:print
  177. 1860 print"orbit eccentricity"
  178. 1870 ifec(cm)<.01thenprint0:print:goto1890
  179. 1880 printec(cm):print
  180. 1890 print"orbit period"
  181. 1900 printabs(pe(cm))"earth days":print
  182. 1910 print"diameter"
  183. 1920 print" "di$(cm)" km":print
  184. 1930 print"x=continue"
  185. 1940 poke198,0
  186. 1950 getk$
  187. 1960 ifk$="x"thengosub1980:goto1660
  188. 1970 goto1950
  189. 1980 poke808,234:sys49232:sys49248
  190. 1990 pokev+21,2^(qb+1)-1:print""
  191. 2000 fori=2to24:print"";:next:return
  192. 2010 sys49474:sys49497:poke808,237
  193. 2020 pokev+21,0:return
  194.